package com.fzrskj.cloud.free.core.tool;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

public class Config {
	private static Properties prop = new Properties();

	static {
		Config.loadProper();
	}

	/**
	 * 加载配置文件
	 * 
	 * @author
	 */
	public static void loadProper() {
		try {
			String systemName = System.getProperty("os.name");
			InputStream is = null;
			if ((systemName != null) && (systemName.toLowerCase().indexOf("linux") != -1)) {
				is = new FileInputStream("config/config.properties");
				prop.load(is);
				is.close();
			} else {
				is = Config.class.getClassLoader().getResourceAsStream("config/config.properties");
				prop.load(is);

			}
			if (is != null) {
				is.close();

			}
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
	public static String getProper(String key) {
		return prop.getProperty(key);
	}
}
